package com.prothink.controller;

import com.prothink.entity.FenyeNode;
import com.prothink.entity.JsComment;
import com.prothink.service.JsCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @BelongsProject: siyun2
 * @BelongsPackage: com.prothink.controller
 * @Author: Jin
 * @CreateTime: 2022-11-23  10:45
 * @Description: TODO
 */
@Controller
@RequestMapping("/Comment")
@CrossOrigin
public class JsCommentController {
    @Autowired
    private JsCommentService jsCommentService;
/**
 * @
 * @author Jin
 * @date 2022/11/23 11:58
 * @param [params]
 * @return FenyeNode<JsComment>
 */
    //   查看评论和模糊查
    @ResponseBody
    @GetMapping("/getJsComment")
    public FenyeNode<JsComment> getJsComment(JsComment params){
        System.out.println("前端传回数据"+params);
        FenyeNode<JsComment> jsComment1 = jsCommentService.getJsComment(params);
        System.out.println("后端返回数据"+jsComment1);
        return jsComment1;
    }
    /**
     * @
     * @author Jin
     * @date 2022/11/23 11:58
     * @param
     * @return
     */
//    删除评论
    @ResponseBody
    @GetMapping("/delJsComment")
    public int delJsComment(int id){
        return jsCommentService.delJsComment(id);
    }
}
